import 'package:flutter/material.dart';
import 'package:happy_elf_app/utils/adaption.dart';
import 'package:happy_elf_app/utils/color.dart';

class togetherCenter extends StatefulWidget {
  const togetherCenter({super.key});

  @override
  State<togetherCenter> createState() => _togetherCenterState();
}

class _togetherCenterState extends State<togetherCenter>
    with SingleTickerProviderStateMixin {
  late AnimationController _controller;
  List dataList = [];

  @override
  void initState() {
    super.initState();
    _controller = AnimationController(vsync: this);
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: [
          ListView.builder(
            itemCount: dataList.length,
            itemBuilder: (context, index) {
              var item = dataList[index];
              return Container(
                width: 300,
                  decoration: BoxDecoration(
                      color: hexColor('#ffffff'),
                      boxShadow: const [
                        BoxShadow(
                          color: Color(0x19000000),
                          blurRadius: 4,
                          offset: Offset(3, 3),
                          spreadRadius: 0,
                        ),
                        BoxShadow(
                          color: Color(0x19000000),
                          blurRadius: 4,
                          offset: Offset(-2, -2),
                          spreadRadius: 0,
                        )
                      ]),
                  child: Row(
                    children: [
                      Stack(
                        children: [
                          Container(
                            decoration: const BoxDecoration(boxShadow: [
                              BoxShadow(
                                color: Color(0x14000000),
                                blurRadius: 6.02,
                                offset: Offset(3.01, 3.01),
                                spreadRadius: 0,
                              ),
                              BoxShadow(
                                color: Color(0x14000000),
                                blurRadius: 6.02,
                                offset: Offset(-1.50, -1.50),
                                spreadRadius: 0,
                              )
                            ]),
                            child: Image.asset(
                              'lib/assets/images/home/egg.png',
                              width: 100,
                              height: 100,
                            ),
                          ),
                          Positioned(child: 
                          Container(
                            padding: EdgeInsets.symmetric(horizontal: 4, vertical: 10),
                            alignment: Alignment.center,
                            decoration: BoxDecoration(
                              border: Border.all(width: 1.px, color:hexColor('#B5B5B5')),
                              color: Color.fromRGBO(255, 255, 255, 0.7)
                            ),
                            child: Text(item['attribute']),
                          ))
                        ],
                      ),
                      SizedBox(width: 20),
                      Expanded(
                        child: Column(
                          children: [
                            Text(item['name'], style: TextStyle(color: hexColor('#000000'), fontSize: 16)),
                            SizedBox(height: 12),
                            Text(item['text'], style: TextStyle(color: hexColor('#808080'), fontSize: 16)),
                            SizedBox(height: 12),
                            Row(
                              children: [
                                GestureDetector(
                                  child: Container(
                                    decoration: BoxDecoration(
                                      borderRadius: BorderRadius.circular(10.0),
                                      border: Border.all(
                                        width: 1,
                                        color: Color.fromRGBO(0, 0, 0, 0.1)
                                      )
                                    ),
                                    padding: EdgeInsets.symmetric(horizontal: 4, vertical: 8),
                                    child: Text('拒绝'),
                                  ),
                                ),
                                GestureDetector(
                                  child: Container(
                                    decoration: BoxDecoration(
                                      borderRadius: BorderRadius.circular(10.0),
                                      border: Border.all(
                                        width: 1,
                                        color: Color.fromRGBO(0, 0, 0, 0.1)
                                      )
                                    ),
                                    padding: EdgeInsets.symmetric(horizontal: 4, vertical: 8),
                                    child: Text('同意'),
                                  ),
                                )
                              ],
                            )
                          ],
                        ),
                      )
                    ],
                  ),
              );
            }
          )
        ]
      ))
    ;
  }
}